<?php
class CrontabCommand extends BaseCommand
{
    public function actionDaily($date = null)
    {
        if($date === null)
        {
            $date = DateUtility::yesterday();
        }

        echo "\n"."START CRONTAB: actionDaily - $date"."\n";

        try
        {
            LogUtility::import($date);
            DailyUtility::analyze($date);
            DailyUtility::sendMail($date);
        }
        catch(Exception $e)
        {
            echo "\n".$e->getMessage()."\n";
            echo "\n".$e->getTraceAsString()."\n";
        }

        echo "\n"."END CRONTAB: actionDaily - $date"."\n";
    }
}
